package cn.xhc.common.controller;

import javax.servlet.http.HttpServletRequest;

import cn.xhc.common.util.ContantInfoUtil;
import cn.xhc.common.util.PageInfoUtil;

/**
 * Controller的基础类
 * @author Administrator
 *
 */
public class BaseController {
	protected PageInfoUtil proccedPageInfo(HttpServletRequest request){
		PageInfoUtil pageInfoUtil = new PageInfoUtil();
		String page = request.getParameter("page");
		try {
			if(page == null ){
				pageInfoUtil.setCurrentPage(1);
				return pageInfoUtil;
			}
			pageInfoUtil.setCurrentPage(Integer.valueOf(page));
		} catch (NumberFormatException e) {
			ContantInfoUtil.LOGGER.info("类型转换异常");
		}
		return pageInfoUtil;
	}
}
